import execjs
import requests
import user_agent_get


session=requests.Session()
headers={"User-Agent":user_agent_get.user_agent_get(),'origin': 'https://www.saikr.com',
'referer': 'https://www.saikr.com/login','authority': 'www.saikr.com'}
print(headers)
session.headers=headers
url='https://www.saikr.com/login'
session.get(url)

node=execjs.get()
ctx=node.compile(open("./saiKe.js",encoding='utf-8').read())
funName="getmd5('{0}')".format('hlj010107')

pwd=ctx.eval(funName)
print(pwd)
data={'name': '15727651817',
'pass': pwd,'remember': '0'}

resp=session.post(url=url,data=data)
html_set_cookie = requests.utils.dict_from_cookiejar(resp.cookies)
print(html_set_cookie)

session.headers.update({'Host': 'www.saikr.com','Upgrade-Insecure-Requests': '1'})
url='http://www.saikr.com/'

response=session.get(url,headers=headers)
print(response.text)